package com.mask.jvm.c5_gc;

/**
 * 虚拟机栈和本地方法栈测试
 * VM Args: -Xss128k -XX:+PrintGC
 * @author hx
 * @since 2022/1/2 9:47 下午
 */

public class JavaVMStackSOF {
    private int stackLength = 1;
    public void stackLeak() {
        stackLength ++;
        stackLeak();
    }

    public static void main(String[] args) throws Throwable {
        JavaVMStackSOF oom = new JavaVMStackSOF();
        try {
            oom.stackLeak();
        } catch (Throwable e) {
            System.out.println("stack length:" + oom.stackLength);
            throw e;
        }
    }
}
